package com.ruoyi.business.service;

import com.ruoyi.business.domain.DefinitionDetail;
import org.activiti.engine.history.HistoricActivityInstance;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.history.HistoricTaskInstance;
import org.activiti.engine.repository.Deployment;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;

import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.List;

/**
 * Created by wolfcode-lanxw
 */
public interface IProcessService {
    Deployment deploy(String filePath) throws FileNotFoundException;

    ProcessDefinition selectProcessDefinitionByDeploymentId(String deploymentId);

    InputStream getBpmnInputStream(String deploymentId);

    InputStream getPngInputStream(String deploymentId);

    ProcessInstance startProcessInstance(String definitionKey, String businessKey, HashMap<String, Object> variables);

    Task selectTaskByProcessInstanceId(String processInstanceId);

    void addCandidateUser(Task currentTask, Long userId);

    InputStream getProcessImgInputByInstanceId(String instanceId);

    ProcessInstance getProcessInstanceByInstanceId(String instanceId);

    void deleteProcessInstanceByInstanceId(String processInstanceId);

    long selectTodoTaskCount(String definitionKey, String userId);

    List<Task> selectTodoTaskList(String definitionKey, String userId,Integer pageNum,Integer pageSize);

    ProcessInstance selectProcessInstanceByProcessInstanceId(String processInstanceId);

    Task selectTaskByTaskId(String taskId);

    void claimAndComplete(Task task, Long userId, Boolean auditStatus, String comment);

    void claimAndComplete(Task task, Long userId, String comment);

    void setVariable(String taskId,String key, long value);

    long selectDoneTaskCount(String definitionKey, String userId);

    List<HistoricTaskInstance> selectDoneTaskList(String definitionKey, String userId, Integer startNum, Integer pageSize);

    HistoricProcessInstance selectHistoryProcessInstanceById(String processInstanceId);

    List<HistoricActivityInstance> selectHistoricActivityInstanceByInstanceId(String instanceId);

    String selectCommentByTaskId(String taskId);
}
